import type { RemoveMethods } from "@/types/remove-methods";
import {TaskPanel} from "@/store/model/TaskPanel";
import {data} from "autoprefixer";
import path from "path";
import {b} from "@fullcalendar/core/internal-common";

export class SurfaceSettingModel {

    static getNewSurfaceSetting(){
        return new SurfaceSettingModel(false,'\\',0,0,null,false,
            null,false,null, null,null,
            [],'0',[],0,[],0,[],[],0,
            0,[],[],'0','',
            false,false,false,false,'',false,false,'1',[],'1',
            '1',[],[]);

    }


    constructor(fromBackEnd: boolean, path: string, maxId: number, recordTaskId: number | null, recordStartTime: number | null, record: boolean, recordType: number | null, recordWarning: boolean, showLifeModeId: number | null, onLifeModeId: number | null, onLifeModeLastBeginTime: number | null, goalExpandKeys: Array<number>, showGoalInfoId: string, showGoalId: Array<number | null>, showGoalState: number, showFieldId: Array<number | null>, showFieldState: number, fieldExpandKeys: Array<number>, showStageId: Array<number | null>, showTaskTypeState: number, showClockTypeState: number, taskPanels: Array<TaskPanel>, taskPanelExpandNames: Array<string>, showTaskPanelState: string, sigleTaskBoardTabName: string, lifeSwitchValue: boolean, lifeItemSwitchValue: boolean, lifeItemSwitchValue2: boolean, inboxSwitchValue: boolean, inbox: string, notRecord: boolean, recordLife: boolean, chooseLife: string, chooseLifeItems: Array<number>, chooseField: string, chooseFieldSub: string, chooseFieldItems: Array<number>, chooseStageItems: Array<number>) {
        this.fromBackEnd = fromBackEnd;
        this.path = path;
        this.maxId = maxId;
        this.recordTaskId = recordTaskId;
        this.recordStartTime = recordStartTime;
        this.record = record;
        this.recordType = recordType;
        this.recordWarning = recordWarning;
        this.showLifeModeId = showLifeModeId;
        this.onLifeModeId = onLifeModeId;
        this.onLifeModeLastBeginTime = onLifeModeLastBeginTime;
        this.goalExpandKeys = goalExpandKeys;
        this.showGoalInfoId = showGoalInfoId;
        this.showGoalId = showGoalId;
        this.showGoalState = showGoalState;
        this.showFieldId = showFieldId;
        this.showFieldState = showFieldState;
        this.fieldExpandKeys = fieldExpandKeys;
        this.showStageId = showStageId;
        this.showTaskTypeState = showTaskTypeState;
        this.showClockTypeState = showClockTypeState;
        this.taskPanels = taskPanels;
        this.taskPanelExpandNames = taskPanelExpandNames;
        this.showTaskPanelState = showTaskPanelState;
        this.sigleTaskBoardTabName = sigleTaskBoardTabName;
        this.lifeSwitchValue = lifeSwitchValue;
        this.lifeItemSwitchValue = lifeItemSwitchValue;
        this.lifeItemSwitchValue2 = lifeItemSwitchValue2;
        this.inboxSwitchValue = inboxSwitchValue;
        this.inbox = inbox;
        this.notRecord = notRecord;
        this.recordLife = recordLife;
        this.chooseLife = chooseLife;
        this.chooseLifeItems = chooseLifeItems;
        this.chooseField = chooseField;
        this.chooseFieldSub = chooseFieldSub;
        this.chooseFieldItems = chooseFieldItems;
        this.chooseStageItems = chooseStageItems;
    }

    fromBackEnd:boolean;
    path:string;
    maxId:number;

    recordTaskId:number|null;
    recordStartTime:number|null;
    record:boolean;
    recordType:number|null;
    recordWarning:boolean;

    showLifeModeId:number|null;
    onLifeModeId:number|null;
    onLifeModeLastBeginTime:number|null;

    goalExpandKeys:Array<number>;
    showGoalInfoId: string;
    showGoalId:Array<number|null>;
    showGoalState:number;
    showFieldId:Array<number|null>;
    showFieldState:number;
    fieldExpandKeys:Array<number>;
    showStageId:Array<number|null>;
    showTaskTypeState:number;
    showClockTypeState:number;
    taskPanels:Array<TaskPanel>;
    taskPanelExpandNames:Array<string>;
    showTaskPanelState:string;

    sigleTaskBoardTabName:string;

    lifeSwitchValue:boolean;
    lifeItemSwitchValue:boolean;
    lifeItemSwitchValue2:boolean;

    inboxSwitchValue:boolean;
    inbox:string;

    notRecord:boolean;
    recordLife:boolean;
    chooseLife:string;
    chooseLifeItems:Array<number>;
    chooseField:string;
    chooseFieldSub:string;
    chooseFieldItems:Array<number>;
    chooseStageItems:Array<number>;

    setInfo(data: RemoveMethods<SurfaceSettingModel>) {
        Object.assign(this, data);
        if(this.goalExpandKeys === undefined || this.goalExpandKeys == null) this.goalExpandKeys = [];
        if(this.showFieldId === undefined || this.showFieldId == null) this.showFieldId = [];
        if(this.showGoalId === undefined || this.showGoalId == null) this.showGoalId = [];
        if(this.taskPanels === undefined || this.taskPanels == null) this.taskPanels = [];
        if(this.fieldExpandKeys === undefined || this.fieldExpandKeys == null) this.fieldExpandKeys = [];
        if(this.showStageId === undefined || this.showStageId == null) this.showStageId = [];
        if(this.taskPanelExpandNames === undefined || this.taskPanelExpandNames == null) this.taskPanelExpandNames = [];
        if(this.showTaskPanelState === undefined || this.showTaskPanelState == null) this.showTaskPanelState = '0';
        if(this.recordWarning === undefined || this.recordWarning == null) this.recordWarning = false;
        if(this.lifeSwitchValue === undefined || this.lifeSwitchValue == null) this.lifeSwitchValue = false;
        if(this.lifeItemSwitchValue === undefined || this.lifeItemSwitchValue == null) this.lifeItemSwitchValue = false;
        if(this.lifeItemSwitchValue2 === undefined || this.lifeItemSwitchValue2 == null) this.lifeItemSwitchValue2 = false;
        if(this.recordStartTime === undefined || this.recordStartTime == null) this.recordStartTime = 0;

        if(this.inboxSwitchValue === undefined || this.inboxSwitchValue == null) this.inboxSwitchValue = false;
        if(this.inbox === undefined || this.inbox == null) this.inbox = '';

        if(this.notRecord === undefined || this.notRecord == null) this.notRecord =false;
        if(this.recordLife === undefined || this.recordLife == null) this.recordLife = false;
        if(this.chooseLife === undefined || this.chooseLife == null) this.chooseLife ='1';
        if(this.chooseLifeItems === undefined || this.chooseLifeItems == null) this.chooseLifeItems = [];
        if(this.chooseField === undefined || this.chooseField == null) this.chooseField = '1';
        if(this.chooseFieldSub === undefined || this.chooseFieldSub == null) this.chooseFieldSub = '1';
        if(this.chooseFieldItems === undefined || this.chooseFieldItems == null) this.chooseFieldItems =  [];
        if(this.chooseStageItems === undefined || this.chooseStageItems == null) this.chooseStageItems =  [];
    }
}